# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-runner
pkgver=1.1.0
pkgrel=0
pkgdesc="Tool used to launch programs quickly by typing their names"
url="https://github.com/lxqt/lxqt-runner"
arch="all !s390x !armhf" # s390x blocked by muparser
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai liblxqt-dev lxqt-build-tools qt5-qttools-dev
	kwindowsystem-dev libqtxdg-dev lxqt-globalkeys-dev
	menu-cache-dev muparser-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-runner/releases/download/$pkgver/lxqt-runner-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname
}

sha512sums="
f6afeaed839b80cbcc56497536e5b17c11e58cb66eae38d210ecf7689ee0c69d0c1a4e27ed3b70d8d90114711659958f6e9bb35e252feac7339cd6c61bb07a21  lxqt-runner-1.1.0.tar.xz
"
